import Vue from 'vue'
import App from './App.vue'

// 导入工具
import http from './utils/http'
import auth from './utils/auth'
import wechat from './utils/wechat'
import config from './utils/config'
import common from './utils/common'

// 导入API
import userApi from './api/user'
import goodsApi from './api/goods'
import orderApi from './api/order'
import configApi from './api/config'

// 导入store
import store from './store'

Vue.config.productionTip = false

// 全局挂载工具
Vue.prototype.$http = http
Vue.prototype.$auth = auth
Vue.prototype.$wechat = wechat
Vue.prototype.$config = config
Vue.prototype.$common = common

// 全局挂载API
Vue.prototype.$api = {
  user: userApi,
  goods: goodsApi,
  order: orderApi,
  config: configApi
}

// 全局挂载store
Vue.prototype.$store = store

App.mpType = 'app'

const app = new Vue({
  store,
  ...App
})
app.$mount() 